package ro.bluecube.admlocal.registruagricol.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

import ro.bluecube.admlocal.commons.PersistableEntity;

@Entity
@NamedQueries( {
		@NamedQuery(name = "findAllMembri", query = "SELECT M FROM MembruGospodarie M")
		})
@Table(name = "membri_gospodarie")
public class MembruGospodarie extends PersistableEntity{

	private static final long serialVersionUID = 1L;
	
	private String nume;
	private String prenume;
	private String cnp;
	private Sex sex;
	private String cod;
	private Date dataNasterii;
	private String mentiuni;
	
	public void setNume(String nume) {
		this.nume = nume;
	}
	public String getNume() {
		return nume;
	}
	public void setPrenume(String prenume) {
		this.prenume = prenume;
	}
	public String getPrenume() {
		return prenume;
	}
	public void setCnp(String cnp) {
		this.cnp = cnp;
	}
	public String getCnp() {
		return cnp;
	}
	public void setSex(Sex sex) {
		this.sex = sex;
	}
	public Sex getSex() {
		return sex;
	}
	public void setCod(String cod) {
		this.cod = cod;
	}
	public String getCod() {
		return cod;
	}
	public void setDataNasterii(Date dataNasterii) {
		this.dataNasterii = dataNasterii;
	}
	public Date getDataNasterii() {
		return dataNasterii;
	}
	
	@Column(columnDefinition="BLOB DEFAULT NULL")
	public void setMentiuni(String mentiuni) {
		this.mentiuni = mentiuni;
	}
	public String getMentiuni() {
		return mentiuni;
	}
	
	public void setTitular(Titular titular) {
		this.titular = titular;
	}
	
	@JoinColumn(name="TITULAR_ID", referencedColumnName="ID")
	@ManyToOne
	public Titular getTitular() {
		return titular;
	}

	private Titular titular;
}